<script type="text/javascript">
   function main(){  
        var res = 0  
        var a = 1;  
        var b = 1;  
        for(var n = 1 ;n<1000;n++){  
            a = a + b + b  ;
            b = a - b  ;
            if(a.toString().length > b.toString().length) {
            	alert (a+" "+b);
            	res ++;
            }  
        }  
       alert(res)  
   }  
   
   main();
</script>